package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.ClientUserClientFallBack;
import cn.cs.pojo.ClientRepRel;
import cn.cs.pojo.ClientUser;
import cn.cs.pojo.ClientUser;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = ClientUserClientFallBack.class)
public interface RestClientUserClient {

    @RequestMapping(value = "/getClientUserById", method = RequestMethod.POST)
    public ClientUser getClientUserById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getClientUserByAccount", method = RequestMethod.POST)
    public ClientUser getClientUserByAccount(@RequestParam("account") String account) throws Exception;

    @RequestMapping(value = "/getClientUserByPhone", method = RequestMethod.POST)
    public ClientUser getClientUserByPhone(@RequestParam("phone") String phone) throws Exception;

    @RequestMapping(value = "/getClientUserByLikePhone", method = RequestMethod.POST)
    public List<ClientUser> getClientUserByLikePhone(@RequestParam("phone") String phone)throws Exception;

    @RequestMapping(value = "/getClientUserByOpenIdAccountNull", method = RequestMethod.POST)
    public ClientUser getClientUserByOpenIdAccountNull(@RequestParam("openId") String openId) throws Exception;

    @RequestMapping(value = "/getClientUserListByMap", method = RequestMethod.POST)
    public List<ClientUser> getClientUserListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getClientUserCountByMap", method = RequestMethod.POST)
    public Integer getClientUserCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/insertClientUser", method = RequestMethod.POST)
    public Integer insertClientUser(@RequestBody ClientUser clientUser) throws Exception;

    @RequestMapping(value = "/updateClientUser", method = RequestMethod.POST)
    public Integer updateClientUser(@RequestBody ClientUser clientUser) throws Exception;

    @RequestMapping(value = "/updateClientUserByOpenId", method = RequestMethod.POST)
    public Integer updateClientUserByOpenId(@RequestBody ClientUser clientUser) throws Exception;

    @RequestMapping(value = "/updateClientUsersByOpenId", method = RequestMethod.POST)
    public Integer updateClientUsersByOpenId(@RequestBody ClientUser clientUser) throws Exception;

    @RequestMapping(value = "/deleteClientUserById", method = RequestMethod.POST)
    public Integer deleteClientUserById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getClientUserByOpenId", method = RequestMethod.POST)
    public ClientUser getClientUserByOpenId(@RequestParam("openId") String openId) throws Exception;

    @RequestMapping(value = "/insertClientRepRel", method = RequestMethod.POST)
    public Integer insertClientRepRel(@RequestBody ClientRepRel clientRepRel) throws Exception;

    @RequestMapping(value = "/updateClientRepRel", method = RequestMethod.POST)
    public Integer updateClientRepRel(@RequestBody ClientRepRel clientRepRel) throws Exception;

    @RequestMapping(value = "/getWxVersionCode", method = RequestMethod.POST)
    public Map<String, Object> getWxVersionCode() throws Exception;

    @RequestMapping(value = "/setWxVersionCode", method = RequestMethod.POST)
    public Integer setWxVersionCode(@RequestParam("versionCode") String versionCode) throws Exception;

    @RequestMapping(value = "/getUserByRepUserId", method = RequestMethod.POST)
    public List<Map<String, Object>> getUserByRepUserId(@RequestParam("rep_user_id") String rep_user_id) throws Exception;

    @RequestMapping(value = "/saveUserScoreHistory", method = RequestMethod.POST)
    public Integer saveUserScoreHistory(@RequestBody Map<String, Object> map)throws Exception;

    @RequestMapping(value = "/getUserScoreHistoryByUserId", method = RequestMethod.POST)
    public List<Map<String, Object>> getUserScoreHistoryByUserId(@RequestParam("userId") String userId)throws Exception;

    @RequestMapping(value = "/getClientRepRelListByMap", method = RequestMethod.POST)
    public List<ClientRepRel>	getClientRepRelListByMap(Map<String, Object> param)throws Exception;
}

